//
// Created by czmc on 2016/12/26.
//

#include "top_stime21_myneighbours_api_ApiManager.h"
#include "string.h"

extern "C" {

/*
 * Class:     top_stime21_myneighbours_api_ApiManager
 * Method:    init
 * Signature: ()V
 */

char *str(char *a, char *b) {
    int len = strlen(a) + strlen(b);
    char *string = new char[len];
    strcpy(string, a);
    strcat(string, b);
    return string;
}

JNIEXPORT void JNICALL Java_top_stime21_myneighbours_api_ApiManager_init
        (JNIEnv *env, jobject obj) {
   // char *host = "http://182.61.13.190:80";
  char *host = "http://192.168.1.106:8080/help-server/";
    jclass native_clazz = env->GetObjectClass(obj);

    jfieldID fieldID_SEC = env->GetStaticFieldID(native_clazz, "SECRET", "Ljava/lang/String;");
    env->SetStaticObjectField(native_clazz, fieldID_SEC, env->NewStringUTF(
            "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCBa5q4cCFys7pJgmJPOHiFSNXDV7gy+XwJtoiXd93aeiOWhCRvPgKXQfFrOP8HukrO1oceLrcFUPZ9cT3FHhvuQTVV2bdBv0K6fNdfrObpUxurPUX9BdrWKI2bz/rG4u/1byhYjtLsQfeqNsJG2txayeCLcggegZZKD9+IHoZ27QIDAQAB"));

    jfieldID fieldID_API_URL = env->GetStaticFieldID(native_clazz, "API_URL", "Ljava/lang/String;");

    env->SetStaticObjectField(native_clazz, fieldID_API_URL,
                              env->NewStringUTF(host));

}
/**

 */


}